/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2013/03/03
* File: IndexBuffer.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#pragma once

#include <render_system/BaseRenderSystem/IndexBuffer.h>
#include "OGL.h"

namespace HY
{
class OGLIndexBuffer : public IndexBuffer
{
	friend class OGLRenderSystem;
public:
	virtual ~OGLIndexBuffer();
	uint32 getHandle() const;

	virtual void bind();
	virtual void unbind();

	virtual bool create(uint32 elems, uint32 usage, uint32 type);
	virtual void release();

	virtual void* lock(uint32 flags);
	virtual bool unlock();

protected:
	OGLIndexBuffer();
protected:
	uint32		handle_;
	void*		lock_data_;
	uint32		usage_api_;
};
}